﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="ModuleTestSite._Default" %>
<%@ Register TagPrefix="test" TagName="ControlMethodTestControl" Src="~/ControlMethodTestControl.ascx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>AJAX Tester</title>

</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <span style="color: green; font-size: 120%;">This site is configured to run in Medium Trust.</span>
    
        <asp:ScriptManager runat="server" ID="smMain" EnablePageMethods="true">
            <Scripts>
                <asp:ScriptReference Path="~/jquery-1.3.2.js" />
            </Scripts>
        </asp:ScriptManager>
    
        <script type="text/javascript">
            function pageMethodTest() {
                PageMethods.GetRandomColor(pageMethodTestComplete);
            }

            function pageMethodTestComplete(result, userContext, methodName) {
                //alert(result + "\n" + userContext + "\n" + methodName);
                $('#colorbox').css('background', result);
            }
        </script>
    
        <div id="colorbox" style="background: red;">
            <br /><br /><br /><br /><br />
        </div>
        <br /><br />
        <input type="button" value="Random Color (Page Method)" onclick="pageMethodTest()" />
        <br /><br />
        <test:ControlMethodTestControl runat="server" ID="controlMethodTest" />
    </div>
    </form>
</body>
</html>
